<?php
	require_once('Affine.php');
	require_once('Fonctions.php');
    $f = new Affine();
	$f->setA(3);
	$f->setB(4);
  
    $f1 = new Affine();
	$f1->setA(2);
	$f1->setB(1);

    $f2 = new Affine();
	$f2->setA(5);
	$f2->setB(4);

    $f3 = new Affine();
	$f3->setA(3);
	$f3->setB(5);	
	
	$array_affines=array($f,$f1,$f2,$f3);
	
	$fonctions=new Fonctions($array_affines);
	
	$srl=serialize($fonctions);
	echo $srl."<br/>";
	$bdd = new PDO('mysql:host=localhost;dbname=test', 'root', '');
	if($bdd->exec('INSERT INTO classe (id,objet) values (6,\''.$srl.'\')'))
	{
		echo "ca marche";
	}
	
	
?>